This repository was archived by the owner on May 23, 2024. It is now read-only.
Fix bug of zero credit in rate limiter#614
Open
ChenX1993 wants to merge 1 commit intojaegertracing:masterfrom
Open
Fix bug of zero credit in rate limiter#614ChenX1993 wants to merge 1 commit intojaegertracing:masterfrom
ChenX1993 wants to merge 1 commit intojaegertracing:masterfrom
Conversation
yurishkuro
reviewed
Apr 25, 2023
| // NewRateLimiter creates a new ReconfigurableRateLimiter. | ||
| func NewRateLimiter(creditsPerSecond, maxBalance float64) *ReconfigurableRateLimiter { | ||
| balance := maxBalance | ||
| if creditsPerSecond == 0 { |
Member
There was a problem hiding this comment.
seems like it should be invalid condition to instantiate rate limiter with <=0 replenishment rate
Author
There was a problem hiding this comment.
Thanks @yurishkuro.
I feel 0 maybe a valid condition which should have the same effect as {const, 0}.
Supporting zero case will be useful when we want to totally mute the signal from a service endpoint when remotely controlling the sampling from collector using the perOperation strategy. (Setting the probability to 0 is not enough and we have to set the lowerbound to 0 as well).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Fix the bug that zero credit per second can still grand credit for the first request.
Short description of the changes
Additional explanation
I understand the jaeger-client-go is deprecated, and no new PR request is accepted.
I have to create a public PR (not need to merge) in order to patch in our own internal repo following our process.